#pragma config(Sensor, in1,    lnLeft,         sensorLineFollower)
#pragma config(Sensor, in2,    lnMid,          sensorLineFollower)
#pragma config(Sensor, in3,    lnRight,        sensorLineFollower)
#pragma config(Sensor, in6,    lightSensor,    sensorReflection)
#pragma config(Sensor, dgtl1,  snsBall,        sensorTouch)
#pragma config(Sensor, dgtl2,  encLeft,        sensorQuadEncoder)
#pragma config(Sensor, dgtl4,  encRight,       sensorQuadEncoder)
#pragma config(Sensor, dgtl6,  snsFront,       sensorSONAR_inch)
#pragma config(Motor,  port2,           leftWheels,    tmotorServoContinuousRotation, openLoop, reversed)
#pragma config(Motor,  port3,           rightWheels,   tmotorServoContinuousRotation, openLoop)
#pragma config(Motor,  port4,           treads,        tmotorServoContinuousRotation, openLoop)
#pragma config(Motor,  port5,           blocker,       tmotorServoStandard, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{
  bool hasBall=false;
  int numBumps=0;
  int treadSpeed=0;
  int lightVal=0;
  motor[blocker]=-115;
  wait1Msec(1000);


  lightVal=SensorValue(lightSensor);

  while(true)
  {
    motor[leftWheels]  = vexRT[Ch3];   // Left Joystick Y value
    motor[rightWheels] = vexRT[Ch2];   // Right Joystick Y value

    if(vexRT[Btn8R])
    {
      treadSpeed=0;
    }

    if(SensorValue(lightSensor)>200)
    {
      treadSpeed=127;

    }

    motor[treads]=treadSpeed;

    if(vexRT[Btn7L])
    {
      motor[blocker]=127;
    }

    if(vexRT[Btn7R])
    {
      motor[blocker]=-115;
    }

  }



}
